package com.dandelion.admin.config;

import com.rockit.core.http.HttpClientProperties;
import com.rockit.core.http.HttpClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class HttpClientConfiguration {
    @Bean
    @ConfigurationProperties(prefix = "httpclient")
    public HttpClientProperties httpClientProperties() {
        return new HttpClientProperties();
    }

    @Bean
    public HttpClientService httpClientService(@Autowired HttpClientProperties properties) {
        return new HttpClientService(properties);
    }
}
